using Avalonia;
using Avalonia.Controls;
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
using Prism.Navigation.Regions;

namespace JMClient.Views;

public partial class DemoNotes : UserControl
{
    public DemoNotes(IRegionManager regionManager)
    {
        InitializeComponent();
        this.Loaded  += LoadRegion;
        _regionManager = regionManager;
    }
    private readonly IRegionManager _regionManager;
    private void LoadRegion(object? sender, RoutedEventArgs e)
    {
        var currentRm = RegionManager.GetRegionManager(this) ?? RegionManager.GetRegionManager(this.FindControl<Control>("DemoNotesRegionHost"));
        currentRm.RequestNavigate("DemoNotesRegion","NotePagesBrowers");
    }
}